#ifndef EVAL_H
#define EVAL_H

#include "gameState.h"

// forward declaration (cyclic dependency)
class GameState;

// Stores the GameState evaluation result.
// Used to compare two Evaluations.
class Evaluation
{
    public:
        
    // Takes a GameState and evaluates it.
    Evaluation(const GameState& state);
    
    // Compares this Evaluation result with another.
    bool operator<(const Evaluation& second) const;
    
	// XXX:we need all the other comparision operators too
	bool operator!=(const Evaluation& second) const
	{
	  return *this < second || second < *this;
	}
	
	bool operator==(const Evaluation& second) const
	{
	  return !(*this != second);
	}

    // unary operator for minMax algorithm
    friend Evaluation operator-(const Evaluation& old);
        
    void print()
    {
        std::cout << evaluationValue << '\n';       
    }
        
    private:
        // A constructor for the use of operator -
        // Use carefully
        Evaluation(double newValue);
        
        // Some values used in evaluation.
        static const double BLACK_PAWN_VALUE;
        static const double BLACK_KNIGHT_VALUE;
        static const double BLACK_BISHOP_VALUE;
        static const double BLACK_ROOK_VALUE;
        static const double BLACK_QUEEN_VALUE;
        static const double BLACK_KING_VALUE;
        static const double WHITE_PAWN_VALUE;
        static const double WHITE_KNIGHT_VALUE;
        static const double WHITE_BISHOP_VALUE;
        static const double WHITE_ROOK_VALUE;
        static const double WHITE_QUEEN_VALUE;
        static const double WHITE_KING_VALUE;
        static const double EMPTY_VALUE;
        
        static const double mob1;
        static const double mob2;
        static const double mob3;
        static const double mob4;
        
        static const double mobility[8][8];
        
        // Stores the result.
        double evaluationValue;
        
        // The 'true' evaluation. 
        void evaluateState(const GameState& state);
};

#endif
